package com.gastronomy.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gastronomy.constant.Constant;
import com.gastronomy.entity.NavEntity;
import com.gastronomy.entity.User;
import com.gastronomy.service.NavService;

@Controller
@RequestMapping("/nav")
public class NavController {
	@Resource
	private NavService navService;
	
	@RequestMapping("/listNav")
	@ResponseBody
	public List<NavEntity> listNavs(HttpServletRequest request,HttpServletResponse response,Model model){
		 
		User user = (User) request.getSession().getAttribute(Constant.SESSION_USER);
		
		return navService.listNavs(user);
	}
	
}
